package com.heakey.app.controller.front.user;

import com.heakey.app.executor.user.query.UserRecordQueryService;
import com.heakey.app.executor.user.update.UserRecordUpdateService;
import com.heakey.app.model.user.req.UserRecordPageReq;
import com.heakey.app.model.user.req.UserRecordUpdateReq;
import com.heakey.app.model.user.vo.UserRecordVO;
import com.heakey.common.model.PageResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Description TODO
 * @Author Bing
 * @Date 2025/6/5 9:26
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/front/user")
public class UserRecordController {

    private final UserRecordUpdateService  userRecordUpdateService;

    private final UserRecordQueryService userRecordQueryService;

    @GetMapping("/page")
    public PageResult<UserRecordVO> page(UserRecordPageReq req) {
        return userRecordQueryService.queryPage(req);
    }

    @PostMapping("/edit")
    public boolean edit(@RequestBody UserRecordUpdateReq req) {
        return userRecordUpdateService.updateById(req);
    }
}